//
//  SSNormalHeaderView.swift
//  拾舍清洁
//
//  Created by sky.wei on 2023/5/31.
//

import UIKit

class SSNormalFooterView: UIView {
    
    class func footerView()->SSNormalFooterView{
        return Bundle.main.loadNibNamed("SSNormalFooterView", owner: nil, options: nil)?.last as! SSNormalFooterView
    }
   
    @IBOutlet weak var checkoutImg: UIImageView!
    
    @IBOutlet weak var deepImg: UIImageView!
    
    @IBOutlet weak var carpetImg: UIImageView!
    
    @IBOutlet weak var bgView: UIView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        bgView.backgroundColor = UIColor(hex: "#1776CA")
        checkoutImg.isUserInteractionEnabled = true
        let tapGes = UITapGestureRecognizer(target: self, action: #selector(tapedTitleLabel(_:)))
        checkoutImg.addGestureRecognizer(tapGes)

        deepImg.isUserInteractionEnabled = true
        let tapGes2 = UITapGestureRecognizer(target: self, action: #selector(tapedTitleLabel(_:)))
        deepImg.addGestureRecognizer(tapGes2)

        carpetImg.isUserInteractionEnabled = true
        let tapGes3 = UITapGestureRecognizer(target: self, action: #selector(tapedTitleLabel(_:)))
        carpetImg.addGestureRecognizer(tapGes3)

    }
    
    @objc private func tapedTitleLabel(_ tapGes : UITapGestureRecognizer) {
        if(tapGes.view?.tag == 1){
            let vc = SSCheckoutCleanPageViewController.init(nibName: "SSCheckoutCleanPageViewController", bundle: nil)
            UIViewController.current().navigationController?.pushViewController(vc, animated: true)
        }else if (tapGes.view?.tag == 2){
            let vc = SSCleanDetailController.init(nibName: "SSCleanDetailController", bundle: nil)
            vc.typeID = 3
            UIViewController.current().navigationController?.pushViewController(vc, animated: true)
        }else if (tapGes.view?.tag == 3){
            let vc = SSCleanDetailController.init(nibName: "SSCleanDetailController", bundle: nil)
            vc.typeID = 4
            UIViewController.current().navigationController?.pushViewController(vc, animated: true)
        }
 
    }
    
}
